package com.yanmaohu.nikita.data.expression;

import com.yanmaohu.nikita.data.operator.AssignmentOperator;

/**
 * @author Bright Lee
 */
public final class AssignmentExpression extends Expression {

    private AssignmentOperator assignmentOperator;
    private Expression variable;
    private Expression variableValue;

    public AssignmentExpression(int beginIndex, int endIndex, AssignmentOperator assignmentOperator, Expression variable, Expression variableValue) {
        super(beginIndex, endIndex);
        this.assignmentOperator = assignmentOperator;
        this.variable = variable;
        this.variableValue = variableValue;
    }

    public AssignmentExpression(int beginIndex, int endIndex, AssignmentOperator assignmentOperator, Expression variable) {
        this(beginIndex, endIndex, assignmentOperator, variable, null);
    }

    public AssignmentOperator getAssignmentOperator() {
        return assignmentOperator;
    }

    public Expression getVariable() {
        return variable;
    }

    public Expression getVariableValue() {
        return variableValue;
    }

}
